<?php
namespace framework\core;
class Factory{
    public static function M($classname){
        static $model_list=array();
//        admin\model\CategoryModel
        if(!strchr($classname,'\\')){
            $model_name=MODULE.'\\model\\'.$classname;
        } else{
            $model_name=$classname;
        }

        if(!isset($model_list[$model_name])){
            $model_list[$model_name] =new $model_name();
        }
        return $model_list[$model_name];
    }
}